// Copyright (c) 2024, json_wang and contributors
// For license information, please see license.txt

// frappe.ui.form.on("CP_Project_Bonus", {
// 	refresh(frm) {

// 	},
// });
frappe.ui.form.on("CP_Project_Bonus", {
    refresh(frm) {
        frm.add_custom_button('创建奖金发放', () => {
            frm.call('create_issue', { throw_if_missing: true })
                .then(r => {
                    console.log(r);
                    frappe.confirm('创建成功,是否打开查看?',
                        () => {
                            frappe.set_route('Form', r.message.doctype, r.message.name);
                        }, () => {
                            // action to perform if No is selected
                        }); 
                })
        });        
    },
});